package com.hiyee.validate;

import com.hiyee.annotation.CheckUrl;
import com.hiyee.utils.UrlUtil;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class CheckUrlValidate implements ConstraintValidator<CheckUrl, String> {
    @Override
    public boolean isValid(String url, ConstraintValidatorContext constraintValidatorContext) {
        System.out.println("[url校验] 正在校验：" + url);
        return UrlUtil.verifyUrl(url.trim());
    }
}
